using System;
using System.Collections;

namespace Slaks.Graphs.Comparators
{
	public class IdComparer : IComparer
	{
		public int Compare(Vertex x, Vertex y)
		{
			return x.CompareTo(y);
		}

		public int Compare(object x, object y)
		{
			Vertex xx = x as Vertex;
			Vertex yy = y as Vertex;
			if (xx == null || yy == null) throw new ArgumentException("Object passed for comparison is not Vertex");
			return Compare(xx, yy);
		}
	}
}